package com.mode.proxy.pattern;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @Description:
 * @Author: zyf
 * @Time: 2020/9/27 15:13
 */
public class ReflectProxy implements InvocationHandler {

    private Object targer;

    public ReflectProxy(Object targer) {
        this.targer = targer;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.printf("starting");
        method.invoke(targer,args);
        System.out.printf("end.");
        return null;
    }

}
